<!DOCTYPE html><html lang="zh-Hans"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"><meta name="description" content="iOS绘图与动画系列 Animation（四）"><meta name="keywords" content="iOS,动画,绘图"><meta name="author" content="kyren"><meta name="copyright" content="kyren"><title>iOS绘图与动画系列 Animation（四） | Kyren's Blog</title><link rel="shortcut icon" href="/melody-favicon.ico"><link rel="stylesheet" href="/css/index.css?version=1.9.0"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/font-awesome@latest/css/font-awesome.min.css?version=1.9.0"><meta name="format-detection" content="telephone=no"><meta http-equiv="x-dns-prefetch-control" content="on"><link rel="dns-prefetch" href="https://cdn.jsdelivr.net"><link rel="dns-prefetch" href="https://hm.baidu.com"><script>var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "https://hm.baidu.com/hm.js?cf87fcdbd9ab7cf93d894f7c219ae78f";
  var s = document.getElementsByTagName("script")[0]; 
  s.parentNode.insertBefore(hm, s);
})();</script><meta http-equiv="Cache-Control" content="no-transform"><meta http-equiv="Cache-Control" content="no-siteapp"><script src="https://v1.hitokoto.cn/?encode=js&amp;charset=utf-8&amp;select=.footer_custom_text" defer></script><script>var GLOBAL_CONFIG = { 
  root: '/',
  algolia: undefined,
  localSearch: {"path":"search.xml","languages":{"hits_empty":"找不到您查询的内容:${query}"}},
  copy: {
    success: '复制成功',
    error: '复制错误',
    noSupport: '浏览器不支持'
  },
  hexoVersion: '6.2.0'
} </script><meta name="generator" content="Hexo 6.2.0"></head><body><i class="fa fa-arrow-right" id="toggle-sidebar" aria-hidden="true"></i><div id="sidebar" data-display="true"><div class="toggle-sidebar-info text-center"><span data-toggle="切换文章详情">切换站点概览</span><hr></div><div class="sidebar-toc"><div class="sidebar-toc__title">目录</div><div class="sidebar-toc__progress"><span class="progress-notice">你已经读了</span><span class="progress-num">0</span><span class="progress-percentage">%</span><div class="sidebar-toc__progress-bar"></div></div><div class="sidebar-toc__content"><ol class="toc"><li class="toc-item toc-level-1"><a class="toc-link" href="#%E9%9A%90%E5%BC%8F%E5%8A%A8%E7%94%BB%E3%80%81%E6%98%BE%E5%BC%8F%E5%8A%A8%E7%94%BB"><span class="toc-number">1.</span> <span class="toc-text">隐式动画、显式动画</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#%E4%B8%80%E3%80%81%E9%9A%90%E5%BC%8F%E5%8A%A8%E7%94%BB"><span class="toc-number">1.0.0.1.</span> <span class="toc-text">一、隐式动画</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E4%BA%8C%E3%80%81%E6%98%BE%E5%BC%8F%E5%8A%A8%E7%94%BB"><span class="toc-number">1.0.0.2.</span> <span class="toc-text">二、显式动画</span></a></li></ol></li></ol></li></ol></li></ol></div></div><div class="author-info hide"><div class="author-info__avatar text-center"><img src="https://avatars.githubusercontent.com/u/5827823?v=4"></div><div class="author-info__name text-center">kyren</div><div class="author-info__description text-center">huluo的技术博客</div><div class="follow-button"><a target="_blank" rel="noopener" href="https://github.com/huluo666">Follow Me</a></div><hr><div class="author-info-articles"><a class="author-info-articles__archives article-meta" href="/archives"><span class="pull-left">文章</span><span class="pull-right">239</span></a><a class="author-info-articles__tags article-meta" href="/tags"><span class="pull-left">标签</span><span class="pull-right">41</span></a><a class="author-info-articles__categories article-meta" href="/categories"><span class="pull-left">分类</span><span class="pull-right">29</span></a></div><hr><div class="author-info-links"><div class="author-info-links__title text-center">Links</div><a class="author-info-links__name text-center" target="_blank" rel="noopener" href="http://192.168.2.212:9090/">Jira</a><a class="author-info-links__name text-center" target="_blank" rel="noopener" href="http://192.168.2.212:8090/">Confluence</a><a class="author-info-links__name text-center" target="_blank" rel="noopener" href="http://bloc.leniugame.com/">Leniu</a></div></div></div><div id="content-outer"><div class="no-bg" id="top-container"><div id="page-header"><span class="pull-left"> <a id="site-name" href="/">Kyren's Blog</a></span><i class="fa fa-bars toggle-menu pull-right" aria-hidden="true"></i><span class="pull-right menus">   <a class="site-page" href="/">主页</a><a class="site-page" href="/essay">随笔</a><a class="site-page" href="/archives">归档</a><a class="site-page" href="/tags">标签</a><a class="site-page" href="/categories">分类</a><a class="site-page" href="/about">关于</a></span><span class="pull-right"><a class="site-page social-icon search"><i class="fa fa-search"></i><span> 搜索</span></a></span></div><div id="post-info"><div id="post-title">iOS绘图与动画系列 Animation（四）</div><div id="post-meta"><time class="post-meta__date"><i class="fa fa-calendar" aria-hidden="true"></i> 2016-04-08</time></div></div></div><div class="layout" id="content-inner"><article id="post"><div class="article-container" id="post-content"><p>本系列文章很多知识点来源<a target="_blank" rel="noopener" href="http://www.kancloud.cn/manual/ios"><strong>ios核心动画高级技巧</strong></a>一书，提供了完整的绘图动画学习路线，强烈推荐阅读！</p>
<p>前面通过<code>Core Graphics（Quartz 2D）</code>和<code>CAShapeLayer</code>与<code>UIBezierPath</code>结合可以随心所欲的绘制我们想要的图形。</p>
<p>但是有些不足的是绘制的图形都是静态的，动画就是让这些图形动起来。</p>
<h1 id="隐式动画、显式动画"><a href="#隐式动画、显式动画" class="headerlink" title="隐式动画、显式动画"></a>隐式动画、显式动画</h1><p><img src="http://7xr7vj.com1.z0.glb.clouddn.com/2016/04/08/FossyAr_1dtpH2cbIMf5icP8XV8M144.png"></p>
<p><img src="http://ww1.sinaimg.cn/large/65cc0af7gw1dxlusbklpmj.jpg"></p>
<h4 id="一、隐式动画"><a href="#一、隐式动画" class="headerlink" title="一、隐式动画"></a>一、隐式动画</h4><p><strong>1、什么是隐式动画？</strong></p>
<p>每一个UIView内部都默认关联着一个<code>CALayer</code>，我们可以称这个Layer为<code>Root Layer</code>(根层)，所有非<code>Root Layer</code>，也就是手动创建的CALayer对象，都存在着隐式动画</p>
<ul>
<li>当对非RootLayer的部分属性进行修改时，默认会自动产生一些动画效果</li>
<li>而这些属性称为AnimatableProperties(可动画属性)</li>
<li>也就是说，对非根层的layer可动画属性进行修改产生的动画，就称为隐式动画</li>
<li>之所以叫隐式是因为我们并没有指定任何动画的类型。我们仅仅改变了一个属性，然后Core Animation来决定如何并且何时去做动画。</li>
<li>隐式动画是指通过UIView的<code>animateWithDuration:animations:</code>方法创建的动画。无须创建动画对象，只需改变动画层的属性，让核心动画自己去完成动画效果, 例如(CATransaction)。</li>
</ul>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">bounds：用于设置CALayer的宽度和高度。修改这个属性会产生缩放动画</span><br><span class="line">backgroundColor：用于设置CALayer的背景色。修改这个属性会产生背景色的渐变动画</span><br><span class="line">position：用于设置CALayer的位置。修改这个属性会产生平移动画</span><br></pre></td></tr></table></figure>



<p><strong>2、可以通过动画事务(CATransaction)关闭默认的隐式动画效果</strong></p>
<figure class="highlight swift"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br></pre></td><td class="code"><pre><span class="line"><span class="operator">-</span> (view)moveLayer:(<span class="type">BOOL</span>)animation &#123;</span><br><span class="line">    <span class="keyword">if</span> (animation) &#123;</span><br><span class="line">        <span class="comment">// 改变了图层的位置，默认会有动画效果，这叫图层的隐式动画</span></span><br><span class="line">        <span class="keyword">self</span>.myLayer.position <span class="operator">=</span> <span class="type">CGPointMake</span>(<span class="number">100</span>, <span class="number">100</span>);</span><br><span class="line">        [<span class="keyword">self</span>.btnOfMove setTitle:@<span class="string">&quot;还原&quot;</span> forState:<span class="type">UIControlStateNormal</span>];</span><br><span class="line">        <span class="keyword">return</span>;</span><br><span class="line">    &#125;<span class="keyword">else</span> &#123;</span><br><span class="line">        <span class="comment">// 使用事务来去掉图层的隐式动画。</span></span><br><span class="line">        [<span class="type">CATransaction</span> begin];<span class="comment">// 开启事务</span></span><br><span class="line">        [<span class="type">CATransaction</span> setDisableActions:<span class="type">YES</span>];</span><br><span class="line">        </span><br><span class="line">        <span class="keyword">self</span>.myLayer.position <span class="operator">=</span> <span class="type">CGPointMake</span>(<span class="number">150</span>, <span class="number">150</span>);</span><br><span class="line">        </span><br><span class="line">        [<span class="type">CATransaction</span> commit];<span class="comment">// 提交事务</span></span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<p><a target="_blank" rel="noopener" href="http://www.jianshu.com/p/966928e9cf49">http://www.jianshu.com/p/966928e9cf49</a></p>
<p>隐式动画是ios4之后引入sdk的，之前只有显式动画。从官方的介绍来看，两者并没有什么差别，甚至苹果还推荐使用隐式动画，但是这里面有一个问题，就是使用隐式动画后，View会暂时不能接收用户的触摸、滑动等手势。这就造成了当一个列表滚动时，如果对其中的view使用了隐式动画，就会感觉滚动无法主动停止下来，必须等动画结束了才能停止。</p>
<h4 id="二、显式动画"><a href="#二、显式动画" class="headerlink" title="二、显式动画"></a>二、显式动画</h4><p>显式动画是指用户自己通过<code>beginAnimations:context:</code>和<code>commitAnimations</code>创建的动画。</p>
<p>显示动画指的是，需要自己创建和管理动画对象，并且将它们应用到动画层，才能显示动画效果。</p>
<p>显式动画的基类为<code>CAAnimation</code></p>
<p><code>CAAnimation</code>分为这4种，他们分别是</p>
<blockquote>
<ul>
<li><strong>1.CABasicAnimation</strong></li>
<li>通过设定起始点，终点，时间，动画会沿着你这设定点进行移动。</li>
<li><strong>2.CAKeyframeAnimation</strong></li>
<li>Keyframe顾名思义就是关键点的frame，你可以通过设定CALayer的始点、中间关键点、终点的frame，时间，动画会沿你设定的轨迹进行移动</li>
<li><strong>3.CAAnimationGroup</strong></li>
<li>Group也就是组合的意思，就是把对这个Layer的所有动画都组合起来。PS：一个layer设定了很多动画，他们都会同时执行，如何按顺序执行我到时候再讲。</li>
<li><strong>4.CATransition</strong></li>
<li>这个就是苹果帮开发者封装好的一些动画。</li>
</ul>
</blockquote>
<p>1）属性动画—基本动画<code>CABasicAnimation</code></p>
<figure class="highlight swift"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><span class="type">CABasicAnimation</span> <span class="operator">*</span>opAnim <span class="operator">=</span> [<span class="type">CABasicAnimation</span> animationWithKeyPath:<span class="meta">@opacity</span>];</span><br><span class="line">opAnim.duration <span class="operator">=</span> <span class="number">1.0</span>;</span><br><span class="line">opAnim.fromValue <span class="operator">=</span> [<span class="type">NSNumber</span> numberWithFloat:<span class="number">0.1</span>];</span><br><span class="line">opAnim.toValue<span class="operator">=</span> [<span class="type">NSNumber</span> numberWithFloat:<span class="number">1.0</span>];</span><br><span class="line">opAnim.repeatCount <span class="operator">=</span> <span class="number">1</span>;</span><br><span class="line">[view.layer addAnimation:opAnim forKey:<span class="meta">@animateOpacity</span>];</span><br></pre></td></tr></table></figure>

<p>2）属性动画—关键帧动画<code>CAKeyframeAnimation</code></p>
<figure class="highlight swift"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">//<span class="doctag">TODO:</span>CAKeyframeAnimation关键帧动画</span></span><br><span class="line"><span class="operator">-</span> (void)changeColor</span><br><span class="line">&#123;</span><br><span class="line">    <span class="comment">//1.创建CALayer对象</span></span><br><span class="line">    <span class="type">CALayer</span> <span class="operator">*</span>colorLayer <span class="operator">=</span> [<span class="type">CALayer</span> layer];</span><br><span class="line">    colorLayer.frame <span class="operator">=</span> <span class="type">CGRectMake</span>(<span class="number">0</span>, <span class="number">0</span>, <span class="number">64</span>, <span class="number">64</span>);</span><br><span class="line">    colorLayer.position <span class="operator">=</span> <span class="type">CGPointMake</span>(<span class="number">0</span>, <span class="number">150</span>);</span><br><span class="line">    colorLayer.backgroundColor <span class="operator">=</span> [<span class="type">UIColor</span> greenColor].<span class="type">CGColor</span>;</span><br><span class="line">    [<span class="keyword">self</span>.layer addSublayer:colorLayer];</span><br><span class="line">    </span><br><span class="line">    </span><br><span class="line">    <span class="comment">//2.创建关键帧动画</span></span><br><span class="line">    <span class="type">CAKeyframeAnimation</span> <span class="operator">*</span>animation <span class="operator">=</span> [<span class="type">CAKeyframeAnimation</span> animation];</span><br><span class="line">    animation.keyPath <span class="operator">=</span> @<span class="string">&quot;backgroundColor&quot;</span>;</span><br><span class="line">    animation.duration <span class="operator">=</span> <span class="number">2.0</span>;</span><br><span class="line">    animation.values <span class="operator">=</span> @[</span><br><span class="line">                         (__bridge id)[<span class="type">UIColor</span> blueColor].<span class="type">CGColor</span>,</span><br><span class="line">                         (__bridge id)[<span class="type">UIColor</span> redColor].<span class="type">CGColor</span>,</span><br><span class="line">                         (__bridge id)[<span class="type">UIColor</span> greenColor].<span class="type">CGColor</span>,</span><br><span class="line">                         (__bridge id)[<span class="type">UIColor</span> blueColor].<span class="type">CGColor</span> ];</span><br><span class="line">    animation.keyTimes <span class="operator">=</span> @[@(<span class="number">0.0</span>),@(<span class="number">0.3</span>),@(<span class="number">0.6</span>),@(<span class="number">1.0</span>)];</span><br><span class="line">    </span><br><span class="line">    <span class="comment">//3.将动画应用到colorLayer层</span></span><br><span class="line">    [colorLayer addAnimation:animation forKey:<span class="literal">nil</span>];</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>



<p>3、动画组</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br></pre></td><td class="code"><pre><span class="line">//TODO:CAAnimationGroup动画组</span><br><span class="line">- (void)changeColor2</span><br><span class="line">&#123;</span><br><span class="line">    //1.创建CALayer对象</span><br><span class="line">    CALayer *colorLayer = [CALayer layer];</span><br><span class="line">    colorLayer.frame = CGRectMake(0, 0, 64, 64);</span><br><span class="line">    colorLayer.position = CGPointMake(0, 150);</span><br><span class="line">    colorLayer.backgroundColor = [UIColor greenColor].CGColor;</span><br><span class="line">    [self.layer addSublayer:colorLayer];</span><br><span class="line">    </span><br><span class="line">    </span><br><span class="line">    //创建动画1</span><br><span class="line">    CAKeyframeAnimation *animation1 = [CAKeyframeAnimation animation];</span><br><span class="line">    animation1.keyPath = @&quot;position&quot;;</span><br><span class="line">    animation1.path = bezierPath.CGPath;</span><br><span class="line">    animation1.rotationMode = kCAAnimationRotateAuto;</span><br><span class="line">   </span><br><span class="line">    //创建动画2</span><br><span class="line">    CABasicAnimation *animation2 = [CABasicAnimation animation];</span><br><span class="line">    animation2.keyPath = @&quot;backgroundColor&quot;;</span><br><span class="line">    animation2.toValue = (__bridge id)[UIColor redColor].CGColor;</span><br><span class="line">   </span><br><span class="line">    </span><br><span class="line">    //创建动画组</span><br><span class="line">    CAAnimationGroup *groupAnimation = [CAAnimationGroup animation];</span><br><span class="line">    groupAnimation.animations = @[animation1, animation2];</span><br><span class="line">    groupAnimation.duration = 4.0;</span><br><span class="line">    </span><br><span class="line">    </span><br><span class="line">    //将动画应用到Layer层</span><br><span class="line">    [colorLayer addAnimation:groupAnimation forKey:nil];</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>



<p>4、过度动画<code>CATransition</code></p>
<figure class="highlight swift"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">动画的开始与结束的快慢,有五个预置分别为(下同):</span><br><span class="line">kCAMediaTimingFunctionLinear 线性,即匀速</span><br><span class="line">kCAMediaTimingFunctionEaseIn 先慢后快</span><br><span class="line">kCAMediaTimingFunctionEaseOut 先快后慢</span><br><span class="line">kCAMediaTimingFunctionEaseInEaseOut 先慢后快再慢</span><br><span class="line">kCAMediaTimingFunctionDefault 实际效果是动画中间比较快.</span><br></pre></td></tr></table></figure>

<figure class="highlight swift"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br></pre></td><td class="code"><pre><span class="line"><span class="operator">-</span> (void)transitionForView:(<span class="type">UIView</span>)view</span><br><span class="line">&#123;</span><br><span class="line">    <span class="type">CATransition</span> <span class="operator">*</span>caTransition <span class="operator">=</span> [<span class="type">CATransition</span> animation];</span><br><span class="line">    caTransition.duration <span class="operator">=</span> <span class="number">0.5</span>;</span><br><span class="line">    caTransition.delegate <span class="operator">=</span> <span class="keyword">self</span>;</span><br><span class="line">    </span><br><span class="line">    <span class="comment">//设置运动速度  linear, easeIn, easeOut, easeInEaseOut, default</span></span><br><span class="line">    caTransition.timingFunction <span class="operator">=</span> [<span class="type">CAMediaTimingFunction</span> functionWithName:kCAMediaTimingFunctionEaseIn];<span class="comment">//切换速度效果</span></span><br><span class="line">    </span><br><span class="line">    <span class="comment">// kCATransitionFade, kCATransitionMoveIn kCATransitionPush, kCATransitionReveal</span></span><br><span class="line">    caTransition.type <span class="operator">=</span> kCATransitionReveal;<span class="comment">//动画切换风格</span></span><br><span class="line">    </span><br><span class="line">    <span class="comment">//kCATransitionFromRight, kCATransitionFromLeft   kCATransitionFromTop, kCATransitionFromBottom</span></span><br><span class="line">    <span class="comment">//设置子类</span></span><br><span class="line">    caTransition.subtype <span class="operator">=</span> kCATransitionFromLeft;<span class="comment">//动画切换方向</span></span><br><span class="line">    </span><br><span class="line">    [<span class="keyword">self</span>.layer addAnimation:groupAnimation forKey:<span class="literal">nil</span>];</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<p><code>Block</code>块实现</p>
<figure class="highlight swift"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">[<span class="type">UIView</span> animateWithDuration:<span class="type">DURATION</span> animations:<span class="operator">^</span>&#123;</span><br><span class="line">        [<span class="type">UIView</span> setAnimationCurve:<span class="type">UIViewAnimationCurveEaseInOut</span>];</span><br><span class="line">        [<span class="type">UIView</span> setAnimationTransition:transition forView:view cache:<span class="type">YES</span>];</span><br><span class="line">    &#125;];</span><br></pre></td></tr></table></figure>


<p>都有哪些<code>animationWithKeyPath</code>，如图</p>
<p><img src="https://github.com/Coneboy-k/KKCoreAnimation/blob/master/image/2.png?raw=true"></p>
<p>参考：<a target="_blank" rel="noopener" href="https://www.objc.io/issues/12-animations/animations-explained/">https://www.objc.io/issues/12-animations/animations-explained/</a></p>
<p>​	   <a target="_blank" rel="noopener" href="http://www.apeth.com/iOSBook/ch17.html">http://www.apeth.com/iOSBook/ch17.html</a></p>
</div></article><div class="post-copyright"><div class="post-copyright__author"><span class="post-copyright-meta">文章作者: </span><span class="post-copyright-info"><a href="mailto:undefined">kyren</a></span></div><div class="post-copyright__type"><span class="post-copyright-meta">文章链接: </span><span class="post-copyright-info"><a href="http://huluo666.gitee.io/2016/04/08/iOS绘图与动画系列 Animation（四）/">http://huluo666.gitee.io/2016/04/08/iOS绘图与动画系列 Animation（四）/</a></span></div><div class="post-copyright__notice"><span class="post-copyright-meta">版权声明: </span><span class="post-copyright-info">本博客所有文章除特别声明外，均采用 <a target="_blank" rel="noopener" href="https://creativecommons.org/licenses/by-nc-sa/4.0/">CC BY-NC-SA 4.0</a> 许可协议。转载请注明来自 <a href="http://huluo666.gitee.io">Kyren's Blog</a>！</span></div></div><div class="post-meta__tag-list"><a class="post-meta__tags" href="/tags/iOS-%E5%8A%A8%E7%94%BB-%E7%BB%98%E5%9B%BE/">iOS,动画,绘图</a></div><nav id="pagination"><div class="prev-post pull-left"><a href="/2016/04/08/iOS%E7%BB%98%E5%9B%BE%E4%B8%8E%E5%8A%A8%E7%94%BB%E7%B3%BB%E5%88%97%20CAShapeLayer%EF%BC%88%E4%B8%89%EF%BC%89/"><i class="fa fa-chevron-left">  </i><span>iOS绘图与动画系列 CAShapeLayer（三）</span></a></div><div class="next-post pull-right"><a href="/2016/04/08/iOS%E7%BB%98%E5%9B%BE%E4%B8%8E%E5%8A%A8%E7%94%BB%E7%B3%BB%E5%88%97%20UIDynamicAnimator%EF%BC%88%E4%BA%94%EF%BC%89/"><span>iOS绘图与动画系列 UIDynamicAnimator（五）</span><i class="fa fa-chevron-right"></i></a></div></nav></div></div><footer><div class="layout" id="footer"><div class="copyright">&copy;2022 By kyren</div><div class="framework-info"><span>驱动 - </span><a target="_blank" rel="noopener" href="http://hexo.io"><span>Hexo</span></a><span class="footer-separator">|</span><span>主题 - </span><a target="_blank" rel="noopener" href="https://github.com/Molunerfinn/hexo-theme-melody"><span>Melody</span></a></div><div class="footer_custom_text">hitokoto</div><div class="busuanzi"><script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script><span id="busuanzi_container_page_pv"><i class="fa fa-file"></i><span id="busuanzi_value_page_pv"></span><span></span></span></div></div></footer><i class="fa fa-arrow-up" id="go-up" aria-hidden="true"></i><script src="https://cdn.jsdelivr.net/npm/animejs@latest/lib/anime.min.js"></script><script src="https://cdn.jsdelivr.net/npm/jquery@latest/dist/jquery.min.js"></script><script src="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.js"></script><script src="https://cdn.jsdelivr.net/npm/velocity-animate@latest/velocity.min.js"></script><script src="https://cdn.jsdelivr.net/npm/velocity-ui-pack@latest/velocity.ui.min.js"></script><script src="/js/utils.js?version=1.9.0"></script><script src="/js/fancybox.js?version=1.9.0"></script><script src="/js/sidebar.js?version=1.9.0"></script><script src="/js/copy.js?version=1.9.0"></script><script src="/js/fireworks.js?version=1.9.0"></script><script src="/js/transition.js?version=1.9.0"></script><script src="/js/scroll.js?version=1.9.0"></script><script src="/js/head.js?version=1.9.0"></script><script src="/js/search/local-search.js"></script><script>if(/Android|webOS|iPhone|iPod|iPad|BlackBerry/i.test(navigator.userAgent)) {
  $('#nav').addClass('is-mobile')
  $('footer').addClass('is-mobile')
  $('#top-container').addClass('is-mobile')
}</script><div class="search-dialog" id="local-search"><div class="search-dialog__title" id="local-search-title">本地搜索</div><div id="local-input-panel"><div id="local-search-input"><div class="local-search-box"><input class="local-search-box--input" placeholder="搜索文章"></div></div></div><hr><div id="local-search-results"><div id="local-hits"></div><div id="local-stats"><div class="local-search-stats__hr" id="hr"><span>由</span> <a target="_blank" rel="noopener" href="https://github.com/wzpan/hexo-generator-search" style="color:#49B1F5;">hexo-generator-search</a>
 <span>提供支持</span></div></div></div><span class="search-close-button"><i class="fa fa-times"></i></span></div><div class="search-mask"></div></body></html>